package org.wdcode.back.action.role;

import org.wdcode.back.action.BaseBackHelperAction;
import org.wdcode.back.po.RoleOperate;
import org.wdcode.back.service.RoleOperateService;

/**
 * 角色与操作关系Action
 * @author WD
 * @since JDK6
 * @version 1.0 2009-11-03
 */
public final class RoleOperateAction extends BaseBackHelperAction<RoleOperateService, RoleOperate> {
	private static final long	serialVersionUID	= -8001968836364180099L;
	// 操作ID数组
	private int[]				operIds;

	/**
	 * 修改权限
	 * @return
	 * @throws Exception
	 */
	public String limit() throws Exception {
		return addMessage(getService().editRights(getEntity().getRoleId(), operIds) ? SUCCESS : ERROR);
	}

	/**
	 * 获得操作ID数组
	 * @return 操作ID数组
	 */
	public int[] getOperIds() {
		return operIds;
	}

	/**
	 * 设置操作ID数组
	 * @param operIds 操作ID数组
	 */
	public void setOperIds(int[] operIds) {
		this.operIds = operIds;
	}
}
